#include <iostream>
using namespace std;
#define MAX 1000


/*
	@description: input a integer number n, output it's factorial.
	@author:  libing
*/
int main()
{
    int n;
    while(cin >> n && n >=0)
    {
        int i ,j;
        int a[MAX];
        int p, h;
        a[1] =1;
        p = 1;
        for( i = 2; i <= n; i++)
        {
            for( j = 1, h=0; j <= p; j++)
            {
                a[j] = a[j]*i + h;
                h = a[j] / 10;
                a[j] = a[j] % 10;
            }
            while( h > 0)
            {
                a[j] = h%10;
                h = h/10;
                j++;
            }
            p = j - 1;
        }

        for( i = p; i>= 1; i--)
        {
            cout << a[i] ;
        }
        cout << endl;
    }
    return 0;
}




